package jonggyuni.basic;

import java.util.Scanner;

public class J07_CalenderV1 {

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		final String TITLE = "\t\tJanuary 2005";
		final String HDRLINE="----------------------------------------------------";
		final String HDDAYS="Sun\tMon\tTue\tWed\tThu\tFri\tSat";
		

		
		int skipday;
		System.out.print("년도를 입력하세요 :");//
		skipday = sc.nextInt();

		skipday =(((skipday-1)*365+(skipday-1)/4-(skipday-1)/100+(skipday-1)/400)%7)+1;
		int blank=skipday;	

		
		System.out.println(TITLE);
		System.out.println(HDRLINE);
		System.out.println(HDDAYS);

		
		for(int day=1; day<=(31+blank); day++, --skipday){
			if(skipday>=1){
				/*if(skipday==7){
					System.out.println("");
				}
				else*/
					System.out.print("  "+"\t");
			}
			else if(day%7==0){
				System.out.println((day-blank));
			}
			else
				System.out.print((day-blank)+ "\t");
		}
		
		sc.close();
		
		
	}

}
